package com.baseEnum;

/**
 * 身份类型
 *
 * @Author ri.yang
 * @Since 2016/1/6.
 */
public enum MemberType implements BaseEnum {
    ADMIN(1, "管理员"), TEACHER(2, "老师"), STUDENT(3, "学生");
    private Integer value;
    private String name;

    MemberType(Integer value, String name) {
        this.value = value;
        this.name = name;
    }

    static {
        SystemEnum.register(new SystemEnum("memberType") {
            @Override
            public BaseEnum getEnum(int value) {
                BaseEnum[] enums = values();
                for (BaseEnum be : enums) {
                    if (be.getValue() == value) {
                        return be;
                    }
                }
                return null;
            }
        });
    }

    public int getValue() {
        return value;
    }

    public String getName() {
        return name;
    }
}
